ABC286 D - Money in Hand
提出
code: python
import itertools
n, x = list(map(int, input().split()))
# print(pow(50, 50))
wa = []
for a, b in ab:
tmp = []
for i in range(b+1):
tmp.append(a*i)
wa.append(tmp)
# print(wa)
# 0, 2, 4, 6], [0, 5, 10, 15, 20, 25, 30
# 19 % 5 = 4
解答
code: python
n, x = map(int, input().split())
# 2 19
# 2, 3], [5, 6
# dpij: i種類の硬貨でj円を払うことができるのか for i in range(n):
for j in range(x+1):
for k in range(b+1):
if dpij and j + a*k <= x: print("Yes")
else:
print("No")
テーマ
メモ
提出
code: python
n, x = map(int, input().split())
# print(ab)
# 2, 3], [5, 6
# dp = False * (pow(10, 4) + 5) # for a, b in ab:
# for i in range(1, b+1):
# i 個で
c = []
for a, b in ab:
tmp = []
for i in range(1, b+1):
tmp.append(i*a)
c.append(tmp)
print(c)
# 2, 4, 6], [5, 10, 15, 20, 25, 30
# 1], 2, [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 # pow(2, bn) * n
# for v in c: